package cn.iocoder.yudao.module.pay.wechat.mq;

import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.module.api.pay.wechat.message.WechatOrderInfoSyncMessage;
import cn.iocoder.yudao.module.api.pay.wechat.message.WechatOrderShippingMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 微信发货信息 事件生产者
 *
 * @author 山野羡民（1032694760@qq.com）
 */
@Slf4j
@Component
public class WechatOrderProducer {
    public void sendWechatOrderInfoSyncMessage(String payNo) {
        log.info("[sendWechatOrderInfoSyncMessage][payNo({})]", payNo);
        SpringUtil.getApplicationContext().publishEvent(new WechatOrderInfoSyncMessage(payNo));
    }

    public void sendWechatOrderShippingMessage(String payNo) {
        log.info("[sendWechatOrderShippingMessage][payNo({})]", payNo);
        SpringUtil.getApplicationContext().publishEvent(new WechatOrderShippingMessage(payNo));
    }

}
